package com.lmaye.design.patterns.structural.proxy.dynamicproxy;

import org.junit.Test;

/**
 * -- 客户端测试
 *
 * @author lmay.Zhou
 * @date 2020/11/15 22:57 星期日
 * @qq 379839355
 * @email lmay@lmaye.com
 * @since JDK1.8
 */
public class ClientTest {
    @Test
    public void test() {
        ProxyFactory proxyFactory = new ProxyFactory(new Teacher());
        ITeacher proxyInstance = (ITeacher) proxyFactory.getProxyInstance();
        System.out.println(proxyInstance);
        System.out.println(proxyInstance.getClass());
        proxyInstance.teach();
        System.out.println(proxyInstance.sum(1, 2));
    }
}
